<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.avery.entity.Documentlibrary" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
 if((session.getAttribute("username")==null)){//（10）判断是否为合法访问
 	session.setAttribute("check",0);
 }else{
 	session.setAttribute("check",1);
 }
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<base href="<%=basePath%>">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Doctaskis</title>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/jquery-ui.min.css" rel="stylesheet" type="text/css" media="screen" />
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-ui-1.10.0.custom.js"></script>
<script type="text/javascript">
	$(function() {
	//分别隐藏用户名显示条、退出链接 、我的书签链接、信息维护链接
		$("input:submit,input:reset,button").button();
		$("#userWelcome").hide();
		$("#signout").hide();
		$("#documentField").hide();
		$("#taskField").hide();
		if($("#check").val()==1){
		//当验证通过时，将登录链接隐藏并显示与用户操作相关的链接
			$("#userWelcome").show();
			$("#signout").show();
			$("#documentField").show();
			$("#login").hide();
			
		}
	});
	function goLibrary(){
		if($("#check").val()!=1){
			alert("这是注册成为会员后才有的功能哦！");
			return;
		};
		
		var shref="documentLibrary.do?actMethod=showDocumentLibraryAction";
		window.location.href=shref;
	}
	function goFriendPage(){
		if($("#check").val()!=1){
			alert("这是注册成为会员后才有的功能哦！");
			return;
		};
		
		var shref="jsp/FriendManagement.jsp";
		window.location.href=shref;
	}
	function goTaskPage(){
		if($("#check").val()!=1){
			alert("这是注册成为会员后才有的功能哦！");
			return;
		};
		
		var shref="jsp/TaskManagement.jsp";
		window.location.href=shref;
	}
</script>
</head>
<body>
<input id="check" type="hidden" value="${sessionScope.check}"/>
<div id="wrapper">
	<div id="header">
		<div id="logo">
			<h1><a href="#">doctaskis </a></h1>
			<p> BY AVERY HUO</p>
		</div>
		<div id="menu">
			<ul>
				<li class="first current_page_item"><a href="main.do">首页</a></li>
				<li><a href="javascript:goLibrary()">文档库</a></li>
				<li><a href="javascript:goTaskPage()">日程表</a></li>
				<li><a href="javascript:goFriendPage()">朋友们</a></li>
				<li><a href="#">关于我</a></li>
				<li><a href="#">关于这</a></li>
			</ul>
		</div>
         <div id="userinfo">
           		<a id="userWelcome">Hi,${sessionScope.username}</a>
                <a id="signout" href="user.do?actMethod=quitUserAction">Sign out</a>
                <a id="login" href="jsp/login.jsp">Login</a>
                <a id="register" href="jsp/register.jsp">Register</a>
           </div>
	</div>
	<!-- end #header    -->
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="content">
					<div class="post">
						<h2 class="title">高效文档管理的重要性</h2>
						<p class="meta">Posted by <a href="#">Avery huo</a> on February 6, 2013
					  &nbsp;&bull;&nbsp;  <a href="#" class="permalink">Full article</a></p>
						<div class="entry">
							<p><img src="images/img08.jpg" width="538" height="200" alt="" /></p>
							<p>高效文档管理符合我们今天高速发展的社会，也是每个成功人士必备的静养！</p>
						</div>
					</div>
					<div class="post">
						<h2 class="title"><a href="#">拥有你的日程表，拥有你的成功</a></h2>
						<p class="meta">Posted by <a href="#">Avery Huo</a> on February 6, 2013
					  &nbsp;&bull;&nbsp; <a href="#" class="permalink">Full article</a></p>
						<div class="entry">
							<p><img src="images/img09.jpg" width="538" height="200" alt="" /></p>
							<p>计划着你人生中的每一天，你将不会为过去的时间而遗憾！</p>
						</div>
					</div>
					<div style="clear: both;">&nbsp;</div>
				</div>
				<!-- end #content -->
				<div id="sidebar">
					<ul>
						<li>
							<div id="search" >
								<form method="get" action="#">
									<div>
										<input type="text" name="s" id="search-text" value="" />
										<input type="submit" id="search-submit" value="Find" />
									</div>
								</form>
							</div>
							<div style="clear: both;">&nbsp;</div>
						</li>
						<li>
							<h2>你能在这做什么?</h2>
							<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在这你可以生成你自己的文档，共享它们，记录它们。在这你可以结识好友，增长见识！</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在这你可以高效地管理日程，充实生命中的每一天！</p>
						</li>
						<li id="documentField">
							<h2>我的文档库</h2>
							<ul>
								<%
									Map<String,List> map=(Map<String,List>)request.getAttribute("resultMap");
 									List<Documentlibrary> libraries=map.get("locDocumentLibraries");
   			
 						   			Iterator it=libraries.iterator();
 						   			while(it.hasNext()){
						   				Documentlibrary library=(Documentlibrary)it.next();
						   				
						    			request.setAttribute("library",library);
								 %>
								<li><a href="documentLibrary.do?actMethod=getDocumentAction&locLibraryID=${library.id}">${library.libraryname}</a></li>
								<%} %>
							</ul>
						</li>
						<li id="taskField">
							<h2>我的任务</h2>
							<ul>
								<li><a href="#">Aliquam libero</a></li>
								<li><a href="#">Consectetuer adipiscing elit</a></li>
								<li><a href="#">Metus aliquam pellentesque</a></li>
								<li><a href="#">Suspendisse iaculis mauris</a></li>
								<li><a href="#">Urnanet non molestie semper</a></li>
								<li><a href="#">Proin gravida orci porttitor</a></li>
							</ul>
						</li>
						<li>
							<h2>友情链接</h2>
							<ul>
								<li><a target="_blank" href="http://www.baidu.com">百度一下</a></li>
								<li><a target="_blank" href="http://www.google.com.hk">谷歌一下</a></li>
								<li><a target="_blank" href="http://www.csdn.net">CSDN</a></li>
								<li><a target="_blank" href="http://www.iteye.com">ITEYE</a></li>
								<li><a target="_blank" href="http://www.springsource.org">Spring官网</a></li>
								<li><a target="_blank" href="http://blog.mybatis.org">Mybatis官方论坛</a></li>
							</ul>
						</li>
					</ul>
				</div>
				<!-- end #sidebar -->
				<div style="clear: both;">&nbsp;</div>
			</div>
		</div>
	</div>
	<!-- end #page -->
</div>
<div id="footer">
	<p>Copyright (c) 2013 Avery.com. All rights reserved. Design by Avery.</p>
</div>
<!-- end #footer -->
</body>
</html>
